var GoodsAlarm = {
    id:"GoodsAlarmTable",
    goodsAlarmData:{},
    table:null,
    seItem:null,
    layerIndex: -1
}

/**
 * 初始化表格的列
 */
GoodsAlarm.initColumn = function () {
    return [
        {field: 'selectItem', radio: true},
        {title: '商品id', field: 'id', visible: false, align: 'center', valign: 'middle'},
        {title: '商品编码', field: 'goodsCode', visible: true, align: 'center', valign: 'middle'},
        {title: '商品名称', field: 'goodsName', visible: true, align: 'center', valign: 'middle'},
        {title: '商品型号', field: 'goodsModel', visible: true, align: 'center', valign: 'middle'},
        {title: '商品计量单位', field: 'goodsUnit', visible: true, align: 'center', valign: 'middle'},
        {title: '采购价', field: 'goodsPurchasePrice', visible: true, align: 'center', valign: 'middle'},
        {title: '出售价格', field: 'goodsSellingPrice', visible: true, align: 'center', valign: 'middle'},
        {title: '库存数量', field: 'goodsInventoryQuantity', visible: true, align: 'center', valign: 'middle'},
        {title: '库存下限', field: 'goodsMinNum', visible: true, align: 'center', valign: 'middle'},
        {title: '商品上次采购价格', field: 'goodsLastPurchasePrice', visible: false, align: 'center', valign: 'middle'},
        {title: '创建者', field: 'createBy', visible: false, align: 'center', valign: 'middle'},
        {title: '创建时间', field: 'createDate', visible: false, align: 'center', valign: 'middle'},
        {title: '更新者', field: 'updateBy', visible: false, align: 'center', valign: 'middle'},
        {title: '更新时间', field: 'updateDate', visible: false, align: 'center', valign: 'middle'},
        {title: '备注信息', field: 'remarks', visible: false, align: 'center', valign: 'middle'},
        {title: '删除标记（0：正常；1：删除）', field: 'delFlag', visible: false, align: 'center', valign: 'middle'},
        {title: '供应商名称', field: 'supplierId', visible: false, align: 'center', valign: 'middle'},
        {title: '商品分类id', field: 'goodsCategoryId', visible: false, align: 'center', valign: 'middle'}
    ];
};

/**
 * 搜索方法
 */
GoodsAlarm.search = function(){
    var queryData = {};
    queryData['goodsCode'] = $("#goodsCode").val();
    queryData['goodsName'] = $("#goodsName").val();
    GoodsAlarm.table.refresh({query: queryData});
    this.table.refresh()
}

/**
 * 清除方法
 */
GoodsAlarm.clear = function(){
    $("#goodsCode").val('');
    $("#goodsName").val('');
}


$(function () {
    var defaultColumns = GoodsAlarm.initColumn();
    var table = new BSTable(GoodsAlarm.id, "/managerGoods/goodsAlarm/list", defaultColumns);
    table.setShowRefresh(false);
    table.setShowColumns(false);
    table.setTableHeight(0);
    GoodsAlarm.table = table.init();
})